<template>
  <el-dialog
    title="详情"
    :close-on-click-modal="false"
    append-to-body
    :visible.sync="visible"
    class="jsbos-dialog jsbos-dialog_center"
    lock-scroll
    width="600px"
  >
    <el-row :gutter="15" class="">
      <el-form
        ref="elForm"
        :model="dataForm"
        size="small"
        label-width="100px"
        label-position="right"
      >
        <template v-if="!loading">
          <el-col :span="24">
            <el-form-item label="上级目录" prop="parentId">
              <p>{{ dataForm.parentId }}</p>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="目录编码" prop="enCode">
              <p>{{ dataForm.enCode }}</p>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="目录名称" prop="fullName">
              <p>{{ dataForm.fullName }}</p>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="排序" prop="sortCode">
              <p>{{ dataForm.sortCode }}</p>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="全路径名" prop="treeNames">
              <p>{{ dataForm.treeNames }}</p>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="描述" prop="description">
              <p>{{ dataForm.description }}</p>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="有效标志" prop="enabledMark">
              <p>{{ dataForm.enabledMark }}</p>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="全局标识" prop="globalMark">
              <p>{{ dataForm.globalMark | dynamicText(globalMarkOptions) }}</p>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="所属组织" prop="organizeTdsTree">
              <p>{{ dataForm.organizeTdsTree }}</p>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="所属公司" prop="companyId">
              <p>{{ dataForm.companyId }}</p>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="24">
            <el-form-item label="删除标志" prop="deleteMark">
              <p>{{ dataForm.deleteMark }}</p>
            </el-form-item>
          </el-col> -->
        </template>
      </el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false"> 取 消</el-button>
    </span>
  </el-dialog>
</template>
<script>
import { getDetail } from "@/views/exam/api/category";
import PrintBrowse from "@/components/print-browse";
export default {
  components: { PrintBrowse },
  props: [],
  data() {
    return {
      visible: false,
      loading: false,
      printBrowseVisible: false,
      printId: "",
      dataForm: {
        id: "",
        enCode: "",
        fullName: "",
        parentId: "",
        sortCode: 0,
        parentIds: "",
        description: "",
        enabledMark: 1,
        globalMark: "1",
        organizeTdsTree: [],
        companyId: "",
        creatorUserId: "",
        creatorTime: "",
        lastModifyUserId: "",
        lastModifyTime: "",
        deleteUserId: "",
        deleteTime: "",
        deleteMark: 0,
      },
      globalMarkOptions: [
        { fullName: "全局", id: "1" },
        { fullName: "组织", id: "2" },
      ],
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    dataInfo(dataAll) {
      let _dataAll = dataAll;
      this.dataForm = _dataAll;
    },

    init(id) {
      this.dataForm.id = id || 0;
      this.visible = true;
      this.$nextTick(() => {
        if (this.dataForm.id) {
          this.loading = true;
          getDetail(this.dataForm.id).then((res) => {
            this.dataInfo(res.data);
            this.loading = false;
          });
        }
      });
    },
  },
};
</script>
